import request from "@/utils/request";

/**
 * 读取当前用户详细信息
 */
export function get() {
  return request({
    url: "/api/my/info",
    method: "get"
  });
}

/**
 * 读取当前用户菜单
 */
export function getMenu() {
  return request({
    url: "/api/my/menus",
    method: "get"
  });
}

/**
 * 更新当前用户详细信息
 * @param {新用户模型} param
 */
export function update(param) {
  return request({
    url: "/api/my/info",
    method: "post",
    data: param,
    headers: { "Content-Type": "application/json" }
  });
}

/**
 * 更新当前用户详细信息
 * @param {新用户模型} param
 */
export function modifyPassword(param) {
  return request({
    url: "/api/my/password",
    method: "post",
    data: param,
    headers: { "Content-Type": "application/json" }
  });
}
